package com.simple.framework.security.custom;

import com.simple.business.domain.enumeration.ThirdAuthenticationEnum;
import org.springframework.security.authentication.AbstractAuthenticationToken;

import java.util.LinkedList;


public class ThirdAuthenticationToken extends AbstractAuthenticationToken {
    private final ThirdAuthenticationEnum thirdAuthenticationEnum;
    private final String code;
    private final String principal;
    public ThirdAuthenticationToken(ThirdAuthenticationEnum thirdAuthenticationEnum,String principal,String code) {
        super(new LinkedList<>());
        this.principal = principal;
        this.code = code;
        this.thirdAuthenticationEnum = thirdAuthenticationEnum;
    }

    public ThirdAuthenticationToken(ThirdAuthenticationEnum thirdAuthenticationEnum,String code) {
        this(thirdAuthenticationEnum,null,code);
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return principal;
    }

    public ThirdAuthenticationEnum getThirdAuthenticationEnum() {
        return thirdAuthenticationEnum;
    }

    public String getCode() {
        return code;
    }
}
